package com.bullsora.kindlerss.business;

import com.bullsora.kindlerss.repository.FeedRepository;

/**
 * @author Sorin Buliarca
 */
public class CleanupService {

  private FeedRepository feedRepository;

  private int daysThreshold;

  public FeedRepository getFeedRepository() {
    return feedRepository;
  }

  public void setFeedRepository(FeedRepository feedRepository) {
    this.feedRepository = feedRepository;
  }

  public int getDaysThreshold() {
    return daysThreshold;
  }

  public void setDaysThreshold(int daysThreshold) {
    this.daysThreshold = daysThreshold;
  }

  public void doCleanup() {
    feedRepository.removeOldEntries(daysThreshold);
  }
}
